{{--默认首页模板--}}

@extends('theme.jishupucms.layouts.app')

{{-- head投放区域 --}}
@section('head-css-cast')
    @parent
    <link rel="stylesheet" href="{{config('jishupucms.css')}}/image-preview-modal.min.css">
@endsection
@section('head-js-cast')
    @parent
@endsection

{{-- seo --}}
@section('title', $meta['title'])
@section('keywords', $meta['keywords'])
@section('description', $meta['description'])

{{-- 核心内容 --}}
@section('content')
    @parent

    {{-- 轮播 --}}
    <x-carousel id="index-banner" class="jsp-banner-section" :list="$swiper_ads" :show-title="false" :show-desc="false"/>

    {{-- 关于我们 --}}
    <div class="jsp-layer index-about">
        <section class="container jsp-container">
            <header class="section-header">
                <h2><a>{{getCategory(7)->name??''}}</a></h2>
                <!-- <p></p> -->
            </header>

            <div class="about-info">
                <div class="row">
                    @if (isset($about_ads) && !empty($about_ads))
                        @foreach ($about_ads as $item)
                            <div class="col-md-4">
                                <div class="card mb-4 shadow-sm">
                                    <img src="{{$item['image_url']??''}}" alt="{{$item['name']}}">
                                    <div class="card-body">
                                        <h4>{{strLimit($item['name'],30,'')}}</h4>
                                        <p class="card-text text-center">{{strLimit($item['description'],40,'')}}</p>
                                    </div>
                                </div>
                            </div>
                        @endforeach
                    @endif
                </div>
            </div>
        </section>
    </div>

    {{-- 服务 --}}
    <div class="jsp-layer ">
        <section class="container index-services jsp-container">
            <header class="section-header">
                @php($serviceCate = getCategory(17))
                @if($serviceCate)
                    <h2>
                        <a {{$serviceCate['href_']}} {{$serviceCate['href_target_']}} {{$serviceCate['rel_']}}>{{$serviceCate->name}}</a>
                    </h2>
                @endif
            </header>

            <div class="row services-info">
                @if (isset($services) && !empty($services))
                    @foreach ($services as $item)
                        <div class="col-md-4 col-sm-4 col-sm-12 services-items">
                            <div class="icon"><i class="{{$item->icon}}"></i></div>
                            <div class="description">
                                <h4>
                                    <a {{$item['href_']}} {{$item['href_target_']}} {{$item['rel_']}}>{{$item->infoPage->title}}</a>
                                </h4>
                                <p>{{strLimit($item->infoPage->description,76, '...')}}</p>
                            </div>
                        </div>
                    @endforeach
                @endif
            </div>
        </section>
    </div>

    {{-- 客户案例：536*314 --}}
    <div class="jsp-layer index-cases">
        <section class="container jsp-container">
            <header class="section-header">
                @php($casesCate = getCategory(13))
                @if($casesCate)
                    <h2>
                        <a {{$casesCate['href_']}} {{$casesCate['href_target_']}} {{$casesCate['rel_']}}>{{$casesCate->name}}</a>
                    </h2>
                @endif
            </header>

            <div class="cases-info">
                <div class="row">
                    @if (isset($cases) && !empty($cases))
                        @foreach ($cases as $item)

                            <div class="col-md-3 col-sm-4">
                                <div class="card mb-3 shadow-sm ">
                                    <figure class="figure">
                                        <img src="{{$item['image_url']??''}}" alt="{{$item['title']}}"
                                             class="figure-img img-fluid">
                                        <a data-title="{{$item['title']}}" class="link-preview"
                                           title="{{__('common.preview')}}"
                                           data-toggle="modal"
                                           data-target="#index-cases-modal"><i
                                                class="fa-solid fa-magnifying-glass-plus"></i>
                                        </a>
                                        <a {{$item['href_']}} {{$item['href_target_']}} {{$item['rel_']}}
                                           class="link-details"
                                           title="{{__('common.view_detail')}}"
                                        ><i class="fa-solid fa-eye"></i></a>
                                    </figure>
                                    <div class="card-body">
                                        <p class="card-text text-center">
                                            <a {{$item['href_']}} {{$item['href_target_']}} {{$item['rel_']}}
                                            >{{strLimit($item['title'],32, '...')}}</a>
                                        </p>
                                    </div>
                                </div>
                            </div>

                        @endforeach
                    @endif
                </div>
            </div>
        </section>
        {{--案例预览模态框--}}
        <x-image-preview-modal id="index-cases" class="" :list="$cases"/>
    </div>

    {{-- 新闻 --}}
    <div class="jsp-layer index-news">
        <section class=" container jsp-container">
            <header class="section-header">
                @php($newsCate = getCategory(3))
                @if($newsCate)
                    <h2>
                        <a {{$newsCate['href_']}} {{$newsCate['href_target_']}} {{$newsCate['rel_']}}>{{$newsCate->name}}</a>
                    </h2>
                @endif
            </header>
            <div class="news-info row">
                {{--图片尺寸建议：600*356--}}
                <x-carousel id="index-news-carousel" class="col-md-6 col-sm-6 col-xs-12 picture-news-list"
                            :list="$swiper_news" name="title" :show-desc="false"/>
                <div class=" text-news-list col-md-6 col-sm-6 col-xs-12">
                    <ul>
                        @if (isset($news) && !empty($news))
                            @foreach ($news as $item)
                                <li>
                                    <div class="text-news-list-left"><span
                                            class="m-date-num">{{$item->created_at->format('d')}}</span>{{$item->created_at->format('Y-m')}}
                                    </div>
                                    <div class="text-news-list-right">
                                        <h4>
                                            <a {{$item['href_']}} {{$item['href_target_']}} {{$item['rel_']}}>
                                                @if($item['top']==1)
                                                    <span>{{__('common.top')}}</span>
                                                @endif
                                                {{strLimit($item['title'],40, '...')}}
                                            </a>
                                        </h4>
                                        <p>{{strLimit($item['description'],62, '...')}}</p>
                                    </div>
                                </li>
                            @endforeach
                        @endif
                    </ul>
                </div>
            </div>
        </section>
    </div>

    {{-- 合作伙伴：友情链接 --}}
    <div class="jsp-layer index-links">
        <section class=" container  jsp-container">
            <header class="section-header">
                <h2><a>{{__('links.links_name')}}</a></h2>
                <!-- <p></p> -->
            </header>
            <div class=" links-info">
                <ul class="row">
                    @if (isset($links) && !empty($links))
                        @foreach ($links as $item)
                            <li class="col-xl-2  col-lg-3 col-md-6 col-sm-12">
                                <a {{$item['href_']}} {{$item['href_target_']}} {{$item['rel_']}}>
                                    @if($item['type'] == 2)
                                        <img src="{{$item['image_url']}}" height="40" alt="{{$item['name']}}">
                                    @else
                                        {{$item['name']}}
                                    @endif
                                </a>
                            </li>
                        @endforeach
                    @endif
                </ul>
            </div>
        </section>
    </div>

@endsection

{{-- 底部投放区域 --}}
@section('footer-cast')
    @parent
@endsection

